package view;

import javax.swing.JOptionPane;

/**
 * Class represents an object to display data for user and get input
 */
public class ContactUser implements InputOutputMngr {

	/**
	 * Notify user that Check has occurred
	 */
	@Override
	public void notifyCheck() {
		
		// notify user
		JOptionPane.showMessageDialog(null, "Check!", "Attention", JOptionPane.INFORMATION_MESSAGE);		
	}

	/**
	 * Display given message and notify user that game is over
	 */
	@Override
	public void notifyGameOver(String msg) {
		
		// notify user
		JOptionPane.showMessageDialog(null, msg, "Game Over", JOptionPane.INFORMATION_MESSAGE);
	}

	/**
	 * Displays options for pieces to replace the Pawn.
	 * Returns user's choice
	 */
	@Override
	public int notifyReplacePawn(String[] options, int defualtOption) {
		
		// display options and return choice
		return JOptionPane.showOptionDialog(null, "Please choose new piece's type", "Replace Pawn", JOptionPane.INFORMATION_MESSAGE, JOptionPane.QUESTION_MESSAGE, null, options, options[defualtOption]);
	}
}
